package com.yanqu.road.entity.activity.commonteam.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.Objects;

@FieldTypeAnnotation(tableName = "t_c_common_team_apply", desc = "通用组队-申请表")
public class CommonTeamApplyData extends DataObject {

    /**
     * 活动ID
     */
    @FieldTypeAnnotation(select = true, update = true, isIndex = true)
    private int activityId;

    /**
     * 分组ID
     */
    @FieldTypeAnnotation(desc = "分组ID")
    private int groupId;

    /**
     * 玩家ID
     */
    @FieldTypeAnnotation(desc = "玩家ID")
    private long userId;

    /**
     * 玩家名称
     */
    @FieldTypeAnnotation(desc = "玩家名称")
    private String userName;

    /**
     * 玩家区服
     */
    @FieldTypeAnnotation(desc = "玩家区服")
    private long serverId;

    /**
     * 申请的队伍ID
     */
    @FieldTypeAnnotation(desc = "申请的队伍ID")
    private int teamId;

    /**
     * 玩家实力
     */
    @FieldTypeAnnotation(desc = "玩家实力")
    private long score;

    /**
     * 是否删除0未删除1已删除
     */
    @FieldTypeAnnotation(desc = "是否删除0未删除1已删除")
    private int delFlag;

    /**
     * 创建时间
     */
    @FieldTypeAnnotation(desc = "创建时间")
    private long createTime;

    public CommonTeamApplyData() {}

    public CommonTeamApplyData(int activityId, int groupId, long userId, String userName, long serverId, int teamId, long score) {
        this.activityId = activityId;
        this.groupId = groupId;
        this.userId = userId;
        this.userName = userName;
        this.serverId = serverId;
        this.teamId = teamId;
        this.score = score;
        this.delFlag = 0;
        this.createTime = System.currentTimeMillis();
        setInsertOption();
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public int getActivityId() {
        return activityId;
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        if (this.groupId != groupId) {
            this.groupId = groupId;
            setOp(DataStatus.Update);
        }
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserName(String userName) {
        if (!Objects.equals(this.userName, userName)) {
            this.userName = userName;
            setOp(DataStatus.Update);
        }
    }

    public String getUserName() {
        return userName;
    }

    public void setServerId(long serverId) {
        if (this.serverId != serverId) {
            this.serverId = serverId;
            setOp(DataStatus.Update);
        }
    }

    public long getServerId() {
        return serverId;
    }

    public void setTeamId(int teamId) {
        if (this.teamId != teamId) {
            this.teamId = teamId;
            setOp(DataStatus.Update);
        }
    }

    public int getTeamId() {
        return teamId;
    }

    public void setScore(long score) {
        if (this.score != score) {
            this.score = score;
            setOp(DataStatus.Update);
        }
    }

    public long getScore() {
        return score;
    }

    public void setDelFlag(int delFlag) {
        if (this.delFlag != delFlag) {
            this.delFlag = delFlag;
            setOp(DataStatus.Update);
        }
    }

    public int getDelFlag() {
        return delFlag;
    }

    public void setCreateTime(long createTime) {
        if (this.createTime != createTime) {
            this.createTime = createTime;
            setOp(DataStatus.Update);
        }
    }

    public long getCreateTime() {
        return createTime;
    }
}
